{extend name="template/base" /}
{block name="style"}
<!--select2样式 start -->
<link href="__LIB__/select2-4.0.3/dist/css/select2.min.css" rel="stylesheet" />
<!--select2样式 end -->
{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$dis_id ?? ''}">
        <!--司机的用户id-->
        <input type="hidden" name="driver_user_id" value="{$du_id ?? ''}">
        <input type="hidden" name="oid" value="{$oid ?? ''}">
        <input type="hidden" name="re" value="{$re ?? ''}">
        <input type="hidden" name="dispatch_id" value="{$data['dispatch_id'] ?? ''}">
        <input type="hidden" name="remark" value="{$data['remark'] ?? ''}">
        <input type="hidden" name="title" value="{$data['title'] ?? ''}">
        <input type="hidden" name="start_time" value="{$data['go_date'] ?? ''}">
        <input type="hidden" name="end_time" value="{$data['end_date'] ?? ''}">
        <input type="hidden" name="car_form" value="{$data['car_form'] ?? ''}">
        <input type="hidden" name="vehicle_level" value="{$data['vehicle_level'] ?? ''}">
        <input type="hidden" name="realname" value="{$data['realname'] ?? ''}">
        <input type="hidden" name="dr_rank_name" value="{$data['dr_rank_id'] ?? ''}">
        <input type="hidden" name="guest_name" value="{$data['guest_name'] ?? ''}">
        <input type="hidden" name="guest_num" value="{$data['guest_num'] ?? 0 }">
        <input type="hidden" name="is_rejection" value="{$is_rejection}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">司机费用：</label>
            <div class="formControls col-xs-3 col-sm-3">
                <input type="munber" name="dir_price" class="input-text" placeholder="请填写司机费用" oninput = "value=value.replace(/[^\d]/g,'')" value="{$list.driver_fee}"/>
                <p class="textarea-numberbar"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">{if $is_rejection == '1'} 更换原因：{else} 中止原因：{/if}</label>
            <div class="formControls col-xs-5 col-sm-5">
                <textarea name="rejection_reason" cols="" rows="" class="textarea"  placeholder="{if $is_rejection == 1}请输入更换的原因{else} 请输入中止的原因{/if}" nullmsg="备注不能为空！"></textarea>
                <p class="textarea-numberbar"></p>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <div id="content"></div>
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script id="td" type="text/html">
    <tr class="text-c">
        <td><input type="hidden" name="traveler[id][]" value="<%=id%>"><%=id%></td>
        <td><%=oid%></td>
        <td><%=name%></td>
        <td><%=phone%></td>
        <td><%=id_card%></td>
        <td><%=adress%></td>
        <td class="f-14">
            <a href="javascript:" class="label label-success radius op-add" data-type="form" onclick="deltd(this)" data-header="1">删除</a>
        </td>
    </tr>
</script>

<!--时间插件-->
<script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/template/template.js"></script>
<!--select2 js 插件-->
<script type="text/javascript" src="__LIB__/select2-4.0.3/dist/js/select2.min.js"></script>
<script>
    function add(){
        var in_undistributed={$vo['dispatch_group_status']=='undistributed'?1:0};
        var is_new={$vo?0:1};
        if(!in_undistributed&&!is_new){
            layer.msg("该状态下不可更改", {
                time: 2000, //2s后自动关闭
            });
            return ;
        }

        var index=layer.open({
            type: 2,
            area: ['700px', '450px'],
            fixed: false, //不固定
            maxmin: true,
            content: '/admin/dispatch_traveler_group/traveler?'+$("input[name='traveler[id][]']").serialize()
        });
        layer.full(index);
    }
    function deltd(ele){
        var in_undistributed={$vo['dispatch_group_status']=='undistributed'?1:0};
        var is_new={$vo?0:1};
        if(!in_undistributed&&!is_new){
            layer.msg("该状态下不可更改", {
                time: 2000, //2s后自动关闭
            });
            return ;
        }
        $(ele).parent().parent().remove();
    }

    $(function () {

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        //车型select2 js部分 start
        var car_type_id = $("#car_type_id").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "vo['car_type_id']"}
        car_type_id.val("{$vo['car_type_id']}").trigger("change");
        {/notempty}
            //车型select2 js部分 end

            $("#form").Validform({
                tiptype: 2,
                ajaxPost: true,
                showAllError: true,
                callback: function (ret){
                    ajax_progress(ret);
                }
            });
        })
</script>
{/block}
